using System;
using System.Web;
using NHibernate;
using NHibernate.Cfg;

namespace XinBang.Session
{

    public sealed class WebApplication
    {
        private const string CurrentSessionKey = "nhibernate.current_session";
        public static readonly Configuration config;
        public static readonly ISessionFactory sessionFactory;
        static WebApplication()
        {
            config = new Configuration();
            sessionFactory = config.Configure().BuildSessionFactory();
        }

        public static ISession GetCurrentSession()
        {
            return sessionFactory.GetCurrentSession();
        }
    }
}